package com.easyOrder.core.mq;

import org.apache.commons.lang.StringUtils;

public enum Topic {
	
	easyorderTT("easyorder-taotao","easyorder-taotao"),
	;
	
	private String name;
	private String desc;
	
	

	private Topic(String name, String desc) {
		this.name = name;
		this.desc = desc;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the desc
	 */
	public String getDesc() {
		return desc;
	}

	/**
	 * @param desc the desc to set
	 */
	public void setDesc(String desc) {
		this.desc = desc;
	}

	private Topic(String desc) {
		this.desc = desc;
	}

	public static Topic parse(String name) {
        if (StringUtils.isBlank(name)) {
            return null;
        }
        Topic [] coll = values();
        for (Topic item : coll) {
            if (item.getName().equals(name)) {
                return item;
            }
        }
        return null;
    }
}
